home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Sample Code / DTS QT Utilities.May-95 / Projects & Test Apps / DigitizerShell / TestFunctions.c < prev    next >
Encoding:
Text File  |  1995-04-30  |  6.7 KB  |  200 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:        TestFunctions.c
  3.  
  4.     Contains:    Test functions for Sequence grabber and vdig tests.
  5.  
  6.     Written by:    DTS
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <1>         4/25/95    khs        first file
  13.        
  14. */
  15.  
  16.  
  17. // INCLUDES
  18. #include "TestFunctions.h"
  19.  
  20. #include "DTSQTUtilities.h"
  21. #include "MacFramework.h"
  22.  
  23.  
  24. // FUNCTIONS
  25. // ______________________________________________________________________
  26. OSErr ShowVDIGInfo(void)
  27. {
  28.     OSErr anErr = noErr;
  29.     VideoDigitizerComponent vd = NULL;
  30.     DigitizerInfo                      digInfo;
  31.     
  32.     printf("\nINFORMATION: Video Digitizer (default component):\n");
  33.     
  34.     vd = SGGetVideoDigitizerComponent( GetDefaultVideoChannel() ); DebugAssert(vd != NULL);
  35.     if(vd == NULL)
  36.     {
  37.         printf("ERROR: Problems getting the vdig component instance from video channel.\n");
  38.         goto Closure;
  39.     }
  40.  
  41.     // Test for live incoming video signal.
  42.     if(QTUDoesVDIGReceiveVideo(vd))
  43.         printf("Vdig is currently receiving a video signal.\n");
  44.     else
  45.         printf("Vdig is currently NOT receiving a video signal.\n");
  46.     
  47.     
  48.     anErr = VDGetDigitizerInfo(vd, &digInfo); DebugAssert(anErr == noErr);
  49.     if(anErr != noErr)
  50.     {
  51.         printf("ERROR: Problems getting Digitizer Information.\n");
  52.         goto Closure;
  53.     }
  54.  
  55.     // Vdig type.
  56.     printf("\nVdig Type = ");
  57.     switch (digInfo.vdigType)
  58.     {
  59.         case vdTypeBasic:
  60.             printf("vdTypeBasic (basic video digitizer, does not support any clipping.\n");
  61.             break;
  62.  
  63.         case vdTypeAlpha:
  64.             printf("vdTypeAlpha (supports clipping by means of an alpha channel).\n");
  65.             break;
  66.  
  67.         case vdTypeMask:
  68.             printf("vdTypeMask (supports clipping by means of a mask plane).\n");
  69.             break;
  70.  
  71.         case vdTypeKey:
  72.             printf("vdTypeKey (supports clipping by means of key colors).\n");
  73.             break;
  74.     }
  75.     
  76.     // Input Capabilities (default ones)
  77.     printf("\nThe vdig handles the following inputs:\n");
  78.     if(digInfo.inputCapabilityFlags & digiInDoesNTSC)
  79.         printf("\tNTSC\n");        
  80.     if(digInfo.inputCapabilityFlags & digiInDoesPAL)
  81.         printf("\tPAL\n");
  82.     if(digInfo.inputCapabilityFlags & digiInDoesSECAM)
  83.         printf("\tSECAM\n");
  84.     if(digInfo.inputCapabilityFlags & digiInDoesGenLock)
  85.         printf("\tGenlock\n");
  86.     if(digInfo.inputCapabilityFlags & digiInDoesComposite)
  87.         printf("\tComposite Video\n");
  88.     if(digInfo.inputCapabilityFlags & digiInDoesSVideo)
  89.         printf("\tS-Video\n");
  90.     if(digInfo.inputCapabilityFlags & digiInDoesComponent)
  91.         printf("\tRGB input video\n");
  92.     if(digInfo.inputCapabilityFlags & digiInDoesColor)
  93.         printf("\tColor input\n");
  94.     if(digInfo.inputCapabilityFlags & digiInDoesBW)
  95.         printf("\tGrayScale input\n");
  96.     
  97.     if(digInfo.inputCurrentFlags & digiInSignalLock)
  98.         printf("\tCurrently the vdig is locked onto the input signal.\n");
  99.         
  100.         
  101.     // Output Capabilities.
  102.         printf("\nThe vdig handles the following output cases:\n");
  103.         printf("Pixel Maps of size (bit): ");
  104.     if(digInfo.outputCapabilityFlags & digiOutDoes1)
  105.         printf("1 ");        
  106.     if(digInfo.outputCapabilityFlags & digiOutDoes2)
  107.         printf("2 ");        
  108.     if(digInfo.outputCapabilityFlags & digiOutDoes4)
  109.         printf("4 ");        
  110.     if(digInfo.outputCapabilityFlags & digiOutDoes8)
  111.         printf("8 ");        
  112.     if(digInfo.outputCapabilityFlags & digiOutDoes16)
  113.         printf("16 ");        
  114.     if(digInfo.outputCapabilityFlags & digiOutDoes32)
  115.         printf("32 ");        
  116.  
  117.     printf("\n");
  118.     
  119.     if(digInfo.outputCapabilityFlags & digiOutDoesDither)
  120.         printf("Handles dithering out.\n");
  121.     if(digInfo.outputCapabilityFlags & digiOutDoesStretch)
  122.         printf("Handles stretching of images.\n");
  123.     if(digInfo.outputCapabilityFlags & digiOutDoesShrink)
  124.         printf("Handles shrinking of images.\n");
  125.     if(digInfo.outputCapabilityFlags & digiOutDoesDouble)
  126.         printf("Handles doubling (stretching to quadruple size) of images.\n");
  127.     if(digInfo.outputCapabilityFlags & digiOutDoesQuad)
  128.         printf("Handles stretching image to 16 times original size.\n");
  129.     if(digInfo.outputCapabilityFlags & digiOutDoesQuarter)
  130.         printf("Handles shrinking image to 1/4 times original size.\n");
  131.     if(digInfo.outputCapabilityFlags & digiOutDoesSixteenth)
  132.         printf("Handles shrinking image to 1/16 times original size.\n");
  133.     if(digInfo.outputCapabilityFlags & digiOutDoesRotate)
  134.         printf("Handles rotation of image displayed.\n");
  135.     if(digInfo.outputCapabilityFlags & digiOutDoesHorizFlip)
  136.         printf("Handles horizontal flip of image displayed.\n");
  137.     if(digInfo.outputCapabilityFlags & digiOutDoesVertFlip)
  138.         printf("Handles vertical flip of image displayed.\n");
  139.     if(digInfo.outputCapabilityFlags & digiOutDoesSkew)
  140.         printf("Handles skew of image displayed.\n");
  141.     if(digInfo.outputCapabilityFlags & digiOutDoesBlend)
  142.         printf("Handles blend of image with matte.\n");
  143.     if(digInfo.outputCapabilityFlags & digiOutDoesWarp)
  144.         printf("Handles warp of image (distortion along an axis).\n");
  145.     if(digInfo.outputCapabilityFlags & digiOutDoesHW_DMA)
  146.         printf("Handles DMA writes to screen or offscreen memory.\n");
  147.     if(digInfo.outputCapabilityFlags & digiOutDoesHWPlayThru)
  148.         printf("Handles Playthrough mode (no need for idle time).\n");
  149.     if(digInfo.outputCapabilityFlags & digiOutDoesILUT)
  150.         printf("Handles inverse lookup tables for indexed color modes.\n");
  151.     if(digInfo.outputCapabilityFlags & digiOutDoesKeyColor)
  152.         printf("Handles clipping by using key colors.\n");
  153.     if(digInfo.outputCapabilityFlags & digiOutDoesAsyncGrabs)
  154.         printf("Can operate asynchronously.\n");
  155.     
  156.     if(digInfo.outputCapabilityFlags & digiOutDoesUnreadableScreenBits)
  157.         printf("Vdig might place pixels on the screeen that can't be used when compressing images.\n");
  158.     if(digInfo.outputCapabilityFlags & digiOutDoesCompress)
  159.         printf("Vdig supports compressed source devices.\n");
  160.     if(digInfo.outputCapabilityFlags & digiOutDoesCompressOnly)
  161.         printf("Vdig only provides compressed image data.\n");
  162.     if(digInfo.outputCapabilityFlags & digiOutDoesPlayThruDuringCompress)
  163.         printf("Vdig can't draw images on the screen while it's delivering compressed images.\n");
  164.     
  165.  
  166.     // Size.
  167.     printf("\n\nSmallest resizable height = \t%d.\n", digInfo.minDestHeight);
  168.     printf("Smallest resizable width = \t%d.\n", digInfo.minDestWidth);
  169.     printf("Largest resizable height = \t%d.\n", digInfo.maxDestHeight);
  170.     printf("Largest resizable width = \t%d.\n", digInfo.maxDestWidth);
  171.     
  172.     // Blending.
  173.     printf("\nBlend level = \t%d (2 if 1-bit mask).\n", digInfo.blendLevels);
  174.  
  175. Closure:
  176.     return anErr;
  177. }
  178.  
  179.  
  180. // ______________________________________________________________________
  181. void SetMyVideoChannelSettings(void)
  182. {
  183.     OSErr anErr = noErr;
  184.     
  185.     anErr = SGSettingsDialog( GetDefaultSGInstance(), GetDefaultVideoChannel(), 0, NULL,
  186.                                             DoTheRightThing, NULL, 0); DebugAssert(anErr == noErr);
  187. }
  188.  
  189.  
  190. // ______________________________________________________________________
  191. void SetMyAudioChannelSettings(void)
  192. {
  193.     OSErr anErr = noErr;
  194.     
  195.     anErr = SGSettingsDialog( GetDefaultSGInstance(), GetDefaultAudioChannel(), 0, NULL,
  196.                                             DoTheRightThing, NULL, 0); DebugAssert(anErr == noErr);
  197. }
  198.  
  199.  
  200.